|
 |
Need to supercharge your Web site? Got a database
of products, and no way to get them online. You need to harness
the power of CGI programming. Using languages such as Perl, ASP
and PHP, you can create interactive, intelligent sites. This is
part one of the series that appeared in .net magazine. Subscribe now
so you don't any of the upcoming articles! |
 |
|
|
|
One
Set up an account with a host that gives you
cgi-bin access and get your hands on an FTP client, such
as CuteFTP or LeechFTP. Make sure the transfer type is set
to ASCII or Text - or your Perl program will not work. Then
upload test-perl.pl to your cgi-bin.
|
Two
If you're using a Unix type host,
such as www.uklinux.net,
you must set the file permissions on any script you upload
to 755. Right click on the file and select CHMOD (CuteFTP)
or Set Attributes (LeechFTP). Check the cgi-bin directory
itself has the same permissions.
|
|
|
|
|
Three
Point your browser at your script - something
like www.you.yourhost.net/cgi-bin/test-perl.pl. Scroll down
the list of environment variables until you get to one like
SCRIPT_FILENAME. This should show you the absolute path
to your Web directory and cgi-bin.
|
Four
If you get an error 500 or an 'Internal
Server Error, you probably didn't set the transfer type
to ASCII. Delete the file and upload it again, transferring
it as ASCII. Then check you've got the permissions right.
The magic 755 tells the server it's an executable script.
|
|
|
|
|
Five
Now create directories for your Web pages exactly
as you had them on your hard drive. Right-click your messages
directory and change its permission to 777 - this tells
the server that anyone can read, write or change into it.
|
Six
Upload chatform.html and chatframes.html
to your chat directory, then upload messages.html to the
messages subdirectory. Right-click on messages.html and
change its permissions to 666 - this ensures the EveryChat
can update the file with new messages.
|
|
|
|
|
Seven
Now edit everycht.cgi. Look for the $filepath='…'
line in the configuration part, and change it to the absolute
path to your messages directory. It should have a forward
slash at the beginning and end, something like '/www/me.myhost.net/chat/messages/'
|
Eight
Save your work and upload it to
your cgi-bin. Change it's permissions to 755 so it's executable,
then point your browser at chatframes.html. If all's gone
well, you'll be able to log on and start chatting right
away. Congratulations!
|
|
|
|
click here for print version of this story.
|
 |
 |
 |
|